package ace.module.captcha.sms.api;

import ace.cmp.core.model.R;
import ace.cmp.sdk.api.SdkApi;
import ace.module.captcha.sms.api.model.dto.CaptchaSmsItemDto;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
 * 验证码 api.
 *
 * @author Caspar
 */
public interface CaptchaSmsItemApi extends SdkApi<CaptchaSmsItemDto, Long> {

  /**
   * 获取有效的验证码数据
   *
   * @param captchaSmsAppId 短信验证appid
   * @param phone     手机号码
   * @return code=0 is success,data is 验证码数据
   */
  R<CaptchaSmsItemDto> getByCaptchaSmsAppIdAndPhone(@Valid @NotNull Long captchaSmsAppId, @Valid @NotBlank String phone);
}